#!/bin/sh

#cd `dirname $0`
#获取软连接的真实路径
DIR=`S=\`readlink "$0"\`; [ -z "$S" ] && S=$0; dirname $S`
cd "$DIR"

echo `pwd`

today=`date +"%Y%m%d"`

#exit

#ip="192.168.4.240"
ip="192.168.4.124"
psw="jianmi1314"

#ip="192.168.4.74"
#psw="123456"
#cd zlfs-service

basePath=/data/python-workspace/captcha_trainer

sshpass -p "$psw" ssh -p 22 $ip "mkdir -p $basePath/"


#复制所有的脚本文件
#sshpass -p "$psw" rsync -aP "-e ssh -p 22" ./*.sh $ip:$basePath/bin/
#sshpass -p "$psw" ssh -p 22 $ip "cd $basePath/bin;chmod +x *.sh"
#开通端口
#sshpass -p "$psw" ssh -p 22 $ip "firewall-cmd --permanent --zone=public --add-port=8030/tcp;firewall-cmd --permanent --zone=public --add-port=20630/tcp;firewall-cmd --reload"

#排除多余的文件夹，配置文件等
#sshpass -p "$psw" rsync -aP "-e ssh -p 22" --exclude={WEB-INF/*,\.*,business_*,*.sql} ./WebRoot/ $ip:/data/jianmi-cloud-old/business_sms_manage_sqlserver/

#sshpass -p "$psw" ssh -p 22 $ip "rm -f $basePath/lib/sms-zlfs-*.jar"
#sshpass -p "$psw" ssh -p 22 $ip "rm -f $basePath/lib/*.jar"sshpass -p "$psw" ssh -p 22 $ip "rm -f $basePath/lib/sms-zlfs-*.jar"
#sshpass -p "$psw" ssh -p 22 $ip "rm -f $basePath/lib/*.jar"

#所有的包
sshpass -p "$psw" rsync -aP "-e ssh -p 22" ./* $ip:$basePath/

#sshpass -p "$psw" rsync -aP "-e ssh -p 22" ./*.sh $ip:$basePath/
#sshpass -p "$psw" rsync -aP "-e ssh -p 22" ./*.conf $ip:$basePath/
##sshpass -p "$psw" rsync -aP "-e ssh -p 22" ./model_68601.h5 $ip:$basePath/
#sshpass -p "$psw" ssh -p 22 $ip "cd $basePath;chmod +x *.sh"
#sshpass -p "$psw" ssh -p 22 $ip "cd $basePath;./start.sh"
